home *** CD-ROM | disk | FTP | other *** search
/ L' Effet Pommier 3 / L'Effet Pommier - Volume 03.iso / Graphismes / 3D / POV-Ray 3.0B5a PPC / POV-Ray 3.0B5a / POVRAY.PPC Application / POV-Ray 3 Templates < prev    next >
Text File  |  1996-02-11  |  41KB  |  1,317 lines

  1. @com.POV-Ray 3 Macintosh Template file
  2. @com.Version: 3.0 beta 3
  3. @com.Last Modified: September 27, 1995 [esp]
  4. @com.               December 28, 1995 [anr]
  5. @com.------------------------------------------------------------
  6. @com.NOTE: Look for "FIXME" string for incomplete sections
  7. @com.============================================================
  8. @mt1.Statements
  9. @com.============================================================
  10. @com.------------------------------
  11. @mt2.background
  12. // Set a color of the background (sky)
  13. background { color red 0.1 green 0.3 blue 0.8 }
  14. @mt2.camera
  15. // set viewer's position in the scene
  16. camera
  17. {
  18. // (camera types)
  19. //  perspective (default) | orthographic | fisheye |
  20. //  ultra_wide_angle | omnimax | panoramic | cylinder 1
  21.   location  <0.0, 1.0, -6.0> // position of camera <X Y Z>
  22.   direction 2.0*z            // which way are we looking <X Y Z> & zoom
  23. //  sky       y                // rarely used
  24.   up        y                // which way is +up <X Y Z>
  25.   right     4/3*x            // which way is +right <X Y Z> and aspect ratio
  26.   look_at   <0.0, 0.0,  0.0> // point center of view at this point <X Y Z>
  27. //  angle FLOAT                // overrides "direction" with specific angle
  28. //  normal { ripples 0.2 }     // perturb the camera lens with a pattern
  29. // (focal blur extras)
  30. //  aperture 0.2               // 0...N (bigger is narrower depth of field)
  31. //  blur_samples 4             // # of rays per pixel
  32. //  focal_point <VECTOR>       // x,y,z point that is in focus
  33. }
  34. @com.------------------------------
  35. @mt2.Fog
  36. //FIXME
  37. // set global atmospheric fog effect in the scene.
  38. // at the fog distance, there will be 63% visibility
  39.   fog {
  40.     fog_type 1 // 1=constant, 2=ground_fog
  41.     distance 10
  42.     color Gray
  43. // turbulence <TURBULENCE>
  44. // turb_depth TURB_DEPTH
  45. // omega OMEGA
  46. // lambda LAMBDA
  47. // octaves OCTAVES
  48. // fog_offset FOG_OFFSET
  49. // fog_alt FOG_ALT
  50.   }
  51. @com.------------------------------
  52. @mt2.Rainbow
  53. //FIXME
  54.   rainbow {
  55.     direction <DIR>
  56.     angle ANGLE
  57.     width WIDTH
  58.     distance DISTANCE
  59.     color_map { COLOUR_MAP }
  60.     [ jitter JITTER ]
  61.     [ up <UP> ]
  62.     [ arc_angle ARC_ANGLE ]
  63.     [ falloff_angle FALLOFF_ANGLE ]
  64.   }
  65. @com.------------------------------
  66. @mt2.Sky Sphere
  67. //FIXME
  68. sky_sphere
  69. {
  70. }
  71. @com.------------------------------
  72. @mt2.adc
  73. global_settings { adc_bailout 20 }
  74. @com.------------------------------
  75. @mt2.assumed gamma
  76. global_settings { assumed_gamma 1.0 }
  77. @com.------------------------------
  78. @mt2.HFGray16
  79. global_settings { HF_Gray_16 }
  80. @com.------------------------------
  81. @mt2.irid_wavelength
  82. global_settings { irid_wavelength <0.25, 0.18, 14> }
  83. @com.------------------------------
  84. @mt2.max_trace_level
  85. global_settings { max_trace_level 20 }
  86. @com.------------------------------
  87. @mt2.max_intersections
  88. global_settings { max_intersections 200 }
  89. @com.------------------------------
  90. @mt2.number_of_waves
  91. global_settings { number_of_waves 10 }
  92. @com.------------------------------
  93. @mt2.ambient light
  94. global_settings { ambient_light { color <COLOR> } }
  95. @com.------------------------------
  96. @mt2.standard includes
  97. // ==== Standard POV-Ray Includes ====
  98. #include "colors.inc"    // Standard Color definitions
  99. #include "textures.inc"    // Standard Texture definitions
  100. @com.------------------------------
  101. @mt2.additional includes
  102. // ==== Additional Includes ====
  103. #include "CHARS.INC    // FIXME-add comments describing each of these
  104. #include "CONSTS.INC
  105. #include "METALS.INC
  106. #include "SHAPES.INC
  107. #include "SHAPES2.INC
  108. #include "SHAPESQ.INC
  109. #include "SKIES.INC
  110. #include "STONES.INC
  111. #include "STONES2.INC
  112. #include "WOODMAPS.INC
  113. #include "WOODS.INC
  114. @com.------------------------------
  115. @mt2.max_intersections
  116. // set the maximum ray tracing intersection depth (1...200) [64]
  117. #max_intersections 64
  118. @com.------------------------------
  119. @mt2.max_trace_level
  120. // set the maximum ray tracing bounce depth (1...20) [5]
  121. #max_trace_level 5
  122. @com.------------------------------
  123. @mt2.Scene file header
  124. // Persistence of Vision Ray Tracer Scene Description File
  125. // File: ?.pov
  126. // Vers: 3
  127. // Desc: ?
  128. // Date: mm/dd/yy
  129. // Auth: ?
  130. //
  131. @com.------------------------------
  132. @mt2.version
  133. // Set the language version of POV-Ray.  Enables or
  134. // disables syntax features that are version-dependent.
  135. // e.g. #version 1.0, or #version 2.0, etc.
  136. // (Note: This can toggle versions anywhere in the source)
  137. #version 2.0  // use POV-Ray 2.0 syntax
  138. @com.============================================================
  139. @mt1.Animation
  140. @com.============================================================
  141. @com.------------------------------
  142. // FIXME-fill in an example with clock
  143. @com.============================================================
  144. @mt1.Expressions
  145. @com.============================================================
  146. @com.------------------------------
  147. @mt2.Built-in Ids
  148. // These identifiers are built in to POV-Ray, ready to use
  149. //  #declare pi = 3.1415926535897932384626
  150. //  #declare true = 1
  151. //  #declare yes = 1
  152. //  #declare on = 1
  153. //  #declare false = 0
  154. //  #declare no = 0
  155. //  #declare off = 0
  156. //  #declare u = <1,0>
  157. //  #declare v = <0,1>
  158. //  #declare x = <1,0,0>
  159. //  #declare y = <0,1,0>
  160. //  #declare z = <0,0,1>
  161. //  #declare t = <0,0,0,1>
  162. @com.------------------------------
  163. @mt2.Math Operators
  164. //   ()   * /   + -   !
  165. #declare MyResult = -2*B + (A*A - 4)
  166. @mt2.Relational Operators
  167. // Relationals must be within parentheses
  168. // Return arithmetic value 0 for false or 1 for true
  169. //   <  <=  =  !=  >=  >
  170. #declare BallColor = pigment { red (clock > 0.5) } // black or red
  171. @com.------------------------------
  172. @mt2.Vector components
  173. // extract each component of a vector:
  174. // #if (MyVector.x > 5) ...
  175. // #if (MyVector.y > 5) ...
  176. // #if (MyVector.z > 5) ...
  177. // #if (MyVector.t > 5) ...
  178. @com.------------------------------
  179. @mt2.Strings
  180. /* various string operations
  181. asc(S1) // Convert 1st character of S1 to ASCII value
  182. chr(A) // Convert extended ASCII value A to a 1 character string
  183. concat(S1,S2) // combine S1 and S2 into one long string
  184. file_exists(S1): Search current and include directories for existence of file S1 (0 or 1)
  185. str(A,L,P) // Convert float A to string, at least L characters long,
  186.            // with P digits after the decimal point (if P is -1, make max)
  187. strcmp(S1,S2) // compare S1 to S2, return -1, 0, or +1 if S2 is <, =, > than S1
  188. strlen(S1) // Returns # of characters in string S1
  189. strlwr(S1) // Lower case of S1
  190. substr(S1,P,L) // Sub-string from S1, start at position P for length L
  191. strupr(S1) // Upper case of S1
  192. val(S1) // Convert string S1 to float
  193. // some special characters that can be used within strings
  194.   "\a" Bell or alarm, 0x07
  195.   "\b" Backspace, 0x08
  196.   "\f" Form feed, 0x0C
  197.   "\n" New line (line feed) 0x0A
  198.   "\r" Carriage return 0x0D
  199.   "\t" Horizontal tab 0x09
  200.   "\v" Vertical tab 0x0B
  201.   "\0" Null 0x00
  202.   "\\" Backslash 0x5C
  203.   "\'" Single quote 0x27
  204. */
  205. @com.============================================================
  206. @mt1.Light sources
  207. @com.============================================================
  208. @com.------------------------------
  209. @mt2.General light definition
  210. /*
  211. light_source
  212. {
  213.     <CENTER>
  214.     color <COLOUR>
  215.     [ spotlight ]
  216.     [ cylinder ]
  217.     [ point_at <POINT> ]
  218.     [ radius RADIUS ]
  219.     [ falloff FALLOFF ]
  220.     [ tightness TIGHTNESS ]
  221.     [ area_light <AXIS1>, <AXIS2>, SIZE1, SIZE2 ]
  222.     [ adaptive ADAPTIVE ]
  223.     [ jitter JITTER ]
  224.     [ looks_like { OBJECT } ]
  225.     [ fade_distance FADE_DISTANCE ]
  226.     [ fade_power FADE_POWER ]
  227.     [ atmospheric_attenuation BOOL ]
  228.     [ shadowless ]
  229. }
  230. */
  231. @com.------------------------------
  232. @mt2.Point light
  233. // create a regular point light source
  234. light_source
  235. {
  236.   0*x // light's position (translated below)
  237.   color red 1.0  green 1.0  blue 1.0  // light's color
  238.   translate <-20, 40, -20>
  239. }
  240. @com.------------------------------
  241. @mt2.Spotlight
  242. // create a point "spotlight" (directed) light source
  243. light_source
  244. {
  245.   0*x // light's position (translated below)
  246.   color red 1.0  green 1.0  blue 1.0  // light's color
  247.   spotlight // this kind of light source
  248.   translate <40, 80, -40>   // <x y z> position of light
  249.   point_at <0, 0, 0> // direction of spotlight
  250.   radius 5       // hotspot (inner, in degrees)
  251.   tightness 50   // tightness of falloff (1...100) lower is softer, higher is tighter
  252.   falloff 8      // intensity falloff radius (outer, in degrees)
  253.  }
  254. @com.------------------------------
  255. @mt2.looks_like
  256. // create a regular point light source
  257. light_source
  258. {
  259.   0*x // light's position (translated below)
  260.   color rgb 1.0  // light's color
  261. // uncomment the next line to give the light source a visible appearance
  262. //  looks_like { sphere { 0*x, 5 pigment { Yellow } } }
  263.   translate <-20, 40, -20>
  264. }
  265. @com.------------------------------
  266. @mt2.area light
  267. // An extended area light (soft shadows)
  268. // WARNING: This can significantly slow down rendering times!
  269. light_source
  270. {
  271.   0*x // light's position (translated below)
  272.   color rgb 1.0  // light's color
  273.   // <widthVector> <heightVector> nLightsWide mLightsHigh
  274.   area_light <8, 0, 0> <0, 8, 0> 4, 4
  275.   adaptive 0    // 0,1,2,3... 
  276.   jitter        // adds random softening of light
  277.   translate <40, 80, -40>   // <x y z> position of light
  278. }
  279. @com.============================================================
  280. @mt1.Misc. Directives
  281. @com.============================================================
  282. @com.------------------------------
  283. @mt2.atmosphere
  284. //FIXME
  285. /*
  286.   #declare ISOTROPIC_SCATTERING         = 1
  287.   #declare MIE_HAZY_SCATTERING          = 2
  288.   #declare MIE_MURKY_SCATTERING         = 3
  289.   #declare RAYLEIGH_SCATTERING          = 4
  290.   #declare HENYEY_GREENSTEIN_SCATTERING = 5
  291.   atmosphere {
  292.     type SCATTERING_TYPE
  293.     distance DISTANCE
  294.     [ scattering SCATTERING ]
  295.     [ eccentricity ECCENTRICITY ]
  296.     [ samples SAMPLES ]
  297.     [ jitter JITTER ]
  298.     [ aa_threshold AA_THRESHOLD ]
  299.     [ aa_level AA_LEVEL ]
  300.     [ color <COLOUR> ]
  301.   }
  302. */
  303. // Atmosphere with Mie scattering, murky atmosphere (dependent on incident light). 
  304. atmosphere
  305. {
  306.   type 3            // Mie scattering
  307.   samples 20        // Number of samples in first distance interval
  308.   distance 20       // Atmosphere density, similar to fog
  309.   scattering 1.5    // Reflectivity of atmosphere, determines brightness
  310.   aa_level 8        // Level of binary subdivision in case of aa
  311.   aa_threshold 0.1  // Threshold for aa to push in
  312.   jitter 0.2        // Amount of sample jittering
  313. }
  314. @com.------------------------------
  315. @mt2.declare
  316. #declare MyColor = color red 0.7 green 0.5 blue 0.3
  317. @com.------------------------------
  318. @mt2.default
  319. // sets the default texture that objects get when they have no texture specified
  320. #default
  321. {
  322.   texture { pigment {color red 1} finish{ambient 0.2} }
  323. }
  324. @com.------------------------------
  325. @mt2.if
  326.   #if (High_Quality)
  327.     // This section is parsed if High_Quality is true
  328.   #end // End of conditional part
  329. // or
  330.   #if (clock > 2)
  331.     // This section is parsed if clock is > 2
  332.   #else
  333.     // This section is parsed if clock is <= 2
  334.   #end // End of conditional part
  335. @com.------------------------------
  336. @mt2.ifdef
  337.   #ifdef (SphereFlake_Shape)
  338.     // This section is  parsed if SphereFlake_Shape is declared
  339.   #else
  340.     // This section is  parsed if SphereFlake_Shape is NOT declared
  341.     #declare SphereFlake_Shape = sphere {0,1} // make a default shape
  342.   #end // End of conditional part
  343. @com.------------------------------
  344. @mt2.switch
  345. // Let's make some constant names
  346. #declare CS_Easy   = 1
  347. #declare CS_Medium = 3
  348. #declare CS_Hard   = 5
  349.  
  350. // Let the user choose the method to use
  351. #declare Complexity_Switch = CS_Medium // or CS_Easy or CS_Hard
  352.  
  353. // Do something dependent on the user's choice
  354. #switch (Complexity_Switch)
  355.   #case (CS_Easy)
  356.   // This statement is done if (Complexity_Switch = CS_Easy)
  357.   #declare MyShape = box{-1,+1}
  358.   #break // end of CS_Easy
  359.   #case (CS_Medium, CS_Hard)
  360.   // This statement is done if Complexity_Switch is CS_Medium
  361.   // or CS_Hard or anything in between
  362.   #declare MyShape = torus{1, 0.5}
  363.   #break // end of CS_Hard
  364.   #else
  365.   // This statement is done if none of the above match
  366.   #declare MyShape = sphere{0,1}
  367. #end
  368. @com.------------------------------
  369. @mt2.while
  370. // Create 10 balls along X axis
  371. #declare BallCount = 0
  372. #while (BallCount < 10)
  373.   sphere { <BallCount,0,0>, 0.5 }
  374.   #declare BallCount = BallCount+1
  375. #end
  376. @com.------------------------------
  377. @mt2.messages
  378.   #debug      "During scene parsing, general info message"
  379.   #fatal      "During scene parsing, display and force POV-Ray to stop"
  380.   #render     "After scene parsing, about to render"
  381.   #statistics "After scene frame is rendered"
  382.   #warning    "During scene parsing"
  383. #end
  384. @com.------------------------------
  385. @mt2.version
  386. #declare Temp_Vers = version    // Save previous value
  387. #version 1.0                    // Change to 1.0 mode
  388. // Version 1.0 stuff goes here ...
  389. #version Temp_Vers              // Restore previous version
  390. @com.============================================================
  391. @mt1.Shapes
  392. @com.============================================================
  393. @com.------------------------------
  394. @mt2.bicubic_patch
  395. // 3D curved finite surface created from a mesh of triangles
  396. bicubic_patch
  397. {
  398.   type 1 // patch_type (0..1)
  399.   // 0 = Bezier patch, just store the triangular vertices
  400.   // 1 = Bezier patch, store all plane equations defined by
  401.   //       the triangulation of the patch into sub patches
  402.    flatness 0.1 // flatness value
  403.   //       flatness_value = 0.01 to 1.0, with higher values
  404.   //        giving flatter, less smooth results
  405.   u_steps 3 // # of triangles to subdivide (1-5)
  406.   v_steps 3 // # of triangles to subdivide (1-5)
  407.   <0, 0, 2> <1, 0, 0> <2, 0, 0> <3, 0, -2>
  408.   <0, 1, 0> <1, 1, 0> <2, 1, 0> <3, 1,  0>
  409.   <0, 2, 0> <1, 2, 0> <2, 2, 0> <3, 2,  0>
  410.   <0, 3, 2> <1, 3, 0> <2, 3, 0> <3, 3, -2>
  411. }
  412. @com.------------------------------
  413. @mt2.box
  414. // create a box that extends between the 2 specified points
  415. box
  416. {
  417.   <-1, -1, -1>  // one corner position <X1 Y1 Z1>
  418.   < 1,  1,  1>  // other corner position <X2 Y2 Z2>
  419. }
  420. @com.------------------------------
  421. @mt2.blob
  422. // create a smooth blobby shape
  423. #declare StrengthVal = 1.0 // (+ or -) strength of component's radiating density
  424. #declare RadiusVal   = 1.0 // (0 < RadiusVal) outer sphere of influence on other components
  425. blob
  426. {
  427.   // threshold (0.0 < threshold <= StrengthVal) surface falloff threshold #
  428.   threshold 0.6
  429.   sphere { < 0.75,   0,    0>, StrengthVal, RadiusVal }
  430.   sphere { <-0.375,  0.65, 0>, StrengthVal, RadiusVal }
  431.   sphere { <-0.375, -0.65, 0>, StrengthVal, RadiusVal }
  432.   cylinder { -z, +z, 0.1, StrengthVal, RadiusVal }
  433.   // [sturm]
  434.   scale 2
  435. }
  436. @com.------------------------------
  437. @mt2.cone
  438. // clipped conical shape
  439. // cone { <END1>, RADIUS1, <END2>, RADIUS2 [open] }
  440. // Where <END1> and <END2> are vectors defining the x,y,z
  441. // coordinates of the center of each end of the cone
  442. // and RADIUS1 and RADIUS2 are float values for the radii
  443. // of those ends.  open, if present, cone is hollow, else capped
  444. cone
  445. {
  446.   1*y,  0.0,
  447.   -1*y, 1.0
  448.   // open
  449. }
  450. @com.------------------------------
  451. @mt2.cubic
  452. // create a 3rd order polynomial surface
  453. cubic
  454. {
  455.   <
  456. // x^3,      x^2y,     x^2z,     x^2,
  457.    0,        0,        0,        0,
  458. // xy^2,     xyz,      xy,       xz^2,
  459.    0,        0,        0,        0,
  460. // xz,       x,        y^3,      y^2z,
  461.    0,        0,        0,        0,
  462. // y^2,      yz^2,     yz,       y,
  463.    0,        0,        0,        0,
  464. // z^3,      z^2,      z,        C
  465.    0,        0,        0,        0
  466.   >
  467.   sturm // optional, slower but reduces speckles
  468. }
  469.  
  470. @mt2.cylinder
  471. // Capped Cylinder, closed [or open ended]
  472. // cylinder { <END1>, <END2>, RADIUS [open] }
  473. //  END1 = coord of one end of cylinder
  474. //  END2 = coord of other end
  475. // RADIUS = size of cylinder
  476. // open = if present, cylinder is hollow, else capped
  477. cylinder
  478. {
  479.   0*x,  3*x,  1
  480.   // open
  481. }
  482. @com.------------------------------
  483. @mt2.disc
  484. // disc <center> <normalVector> radius [holeRadius]
  485. disc
  486. {
  487.   <0, 1, 0>  z,
  488.   1.0,  // outer radius
  489.   0.2   // optional hole radius
  490. }
  491. @com.------------------------------
  492. @mt2.fractal
  493. // create a 3-D slice of a 4-D julia fractal object
  494. julia_fractal
  495.   <-0.083,0.0,-0.83,-0.025> 
  496.   quaternion // hypercomplex?
  497.   cube // TYPE: sqr cube 
  498.   max_iteration 8 
  499.   precision 20 // 10...500? FIXME
  500.   //  slice xx?
  501.  }
  502. @com.------------------------------
  503. @mt2.height_field
  504. // uses image color index as height, extends along X-Z axes
  505. // from <0 0 0> to <1 1 1>
  506. height_field
  507. {
  508.   gif // the file type to read (gif/tga/pot/pgm/ppm/png/sys)
  509.   "plasma3.gif" // the file name to read
  510. //  inverse | texture {...}
  511. //  [smooth] // make smoother surface
  512. //  [water_level N] // truncate/clip below N (0.0 ... 1.0)
  513. // translate VECTOR | rotate VECTOR | scale VECTOR
  514. }
  515. @com.------------------------------
  516. @mt2.lathe
  517. lathe {
  518.   linear_spline // linear_spline | quadratic_spline | cubic_spline
  519.   5, // number of points
  520.   <2, 0>, <3, 0>, <3, 5>, <2, 5>, <2, 0> // the list of <u,v> points
  521.   pigment {Red}
  522. }
  523. @com.------------------------------
  524. @mt2.mesh
  525. // triangle/smooth-triangle mesh shape (example:box)
  526. mesh
  527. {
  528.   /* top side */
  529.   triangle { <-2, 2, -2>, <2, 2, -2>, <2, 2, 2> texture { Red } }
  530.   triangle { <-2, 2, -2>, <-2, 2, 2>, <2, 2, 2> texture { Red } }
  531.   /* bottom side */
  532.   triangle { <-2, -2, -2>, <2, -2, -2>, <2, -2, 2> }
  533.   triangle { <-2, -2, -2>, <-2, -2, 2>, <2, -2, 2> }
  534.   /* left side */
  535.   triangle { <-2, -2, -2>, <-2, -2, 2>, <-2, 2, 2> }
  536.   triangle { <-2, -2, -2>, <-2, 2, -2>, <-2, 2, 2> }
  537.   /* right side */
  538.   triangle { <2, -2, -2>, <2, -2, 2>, <2, 2, 2> texture { Green } }
  539.   triangle { <2, -2, -2>, <2, 2, -2>, <2, 2, 2> texture { Green } }
  540.   /* front side */
  541.   triangle { <-2, -2, -2>, <2, -2, -2>, <-2, 2, -2> texture { Blue } }
  542.   triangle { <-2, 2, -2>, <2, 2, -2>, <2, -2, -2> texture { Blue } }
  543.   /* back side */
  544.   triangle { <-2, -2, 2>, <2, -2, 2>, <-2, 2, 2> }
  545.   triangle { <-2, 2, 2>, <2, 2, 2>, <2, -2, 2> }
  546.   texture
  547.   { // remaining triangles get this texture
  548.     pigment { color rgb<0.9, 0.9, 0.9> }
  549.     finish { ambient 0.2 diffuse 0.7 }
  550.   }
  551. }
  552. @com.------------------------------
  553. @mt2.no_shadow
  554.   // let light pass through a shape, don't cast a shadow
  555.   no_shadow
  556. @com.------------------------------
  557. @mt2.object
  558. #define MyShape = box {-1,1}     // define the shape
  559. object { MyShape }               // create an actual object with that shape
  560. object { MyShape translate 3*x}  // create another object with that shape
  561. @com.------------------------------
  562. @mt2.plane
  563. // create an infinite planar surface
  564. plane
  565. {
  566.   y, // <X Y Z> unit surface normal, vector points "away from surface"
  567.   -1.0 // distance from the origin in the direction of the surface normal
  568. }
  569. @com.------------------------------
  570. @mt2.polygon
  571. // A complex example for a polygon is the letter "P":
  572. polygon
  573. {
  574.   12, // number of points
  575.   <0, 0>, <0, 6>, <4, 6>, <4, 3>, <1, 3>, <1, 0>, <0, 0>, // list of <u,v> points
  576.   <1, 4>, <1, 5>, <3, 5>, <3, 4>, <1, 4>
  577. }
  578. @com.------------------------------
  579. @mt2.polynomial
  580. // create an Nth order polynomial surface
  581. // poly { N <a,b,c...> [sturm] }
  582. // N = order of poly, M terms where M = (N+1)*(N+2)*(N+3)/6
  583. poly
  584. {
  585.   5, // order of polynomial (2...7)
  586.   <
  587. // x^5,        x^4y,       x^4z,       x^4,
  588.    0,          0,          0,          0,
  589. // x^3y^2,     x^3yz,      x^3y,       x^3z^2,
  590.    0,          0,          0,          0,
  591. // x^3z,       x^3,        x^2y^3,     x^2y^2z,
  592.    0,          0,          0,          0,
  593. // x^2y^2,     x^2yz^2,    x^2yz,      x^2y,
  594.    0,          0,          0,          0,
  595. // x^2z^3,     x^2z^2,     x^2z,       x^2,
  596.    0,          0,          0,          0,
  597. // xy^4,       xy^3z,      xy^3,       xy^2z^2,
  598.    0,          0,          0,          0,
  599. // xy^2z,      xy^2,       xyz^3,      xyz^2,
  600.    0,          0,          0,          0,
  601. // xyz,        xy,         xz^4,       xz^3,
  602.    0,          0,          0,          0,
  603. // xz^2,       xz,         x,          y^5,
  604.    0,          0,          0,          0,
  605. // y^4z,       y^4,        y^3z^2,     y^3z,
  606.    0,          0,          0,          0,
  607. // y^3,        y^2z^3,     y^2z^2,     y^2z,
  608.    0,          0,          0,          0,
  609. // y^2,        yz^4,       yz^3,       yz^2,
  610.    0,          0,          0,          0,
  611. // yz,         y,          z^5,        z^4,
  612.    0,          0,          0,          0,
  613. // z^3,        z^2,        z,          C           
  614.    0,          0,          0,          0
  615.   >
  616.   sturm // optional, slower but reduces speckles
  617. }
  618. @com.------------------------------
  619. @mt2.prism
  620. prism {
  621.   cubic_spline // linear_spline | quadratic_spline | cubic_spline
  622.   linear_sweep // linear_sweep | conic_sweep
  623.   -0.5,        // height 1
  624.    0.5,        // height 2
  625.   10,          // number of points
  626.   // the <u,v> points
  627.   < 0.2, -1.0>, < 0.2,  0.2>, < 1.0, -0.2>, < 1.0,  0.2>, < 0.2,  1.0>, 
  628.   <-0.2,  1.0>, <-1.0,  0.2>, <-1.0, -0.2>, <-0.2,  0.2>, <-0.2, -1.0>
  629.   // open
  630.   // sturm
  631. }
  632. @com.------------------------------
  633. @mt2.quadric
  634. // create a quadratic polynomial surface
  635. quadric
  636. {
  637.   <0, 1, 1> //  A x^2  + B y^2  + C z^2  +
  638.   <1, 0, 0> //  D xy   + E xz   + F yz   +
  639.   <0, 3, 0> //  G x    + H y    + I z    +
  640.   2         //  J
  641.   sturm // optional, slower but reduces speckles
  642. }
  643. @com.------------------------------
  644. @mt2.quartic
  645. // create a 4th order polynomial surface
  646. quartic
  647.  {
  648. <
  649. // x^4,        x^3y,       x^3z,       x^3,        x^2y^2,
  650.    0,          0,          0,          0,          0,
  651. // x^2yz,      x^2y,       x^2z^2,     x^2z,       x^2,
  652.    0,          0,          0,          0,          0,
  653. // xy^3,       xy^2z,      xy^2,       xyz^2,      xyz,
  654.    0,          0,          0,          0,          0,
  655. // xy,         xz^3,       xz^2,       xz,         x,
  656.    0,          0,          0,          0,          0,
  657. // y^4,        y^3z,       y^3,        y^2z^2,     y^2z,
  658.    0,          0,          0,          0,          0,
  659. // y^2,        yz^3,       yz^2,       yz,         y,
  660.    0,          0,          0,          0,          0,
  661. // z^4,        z^3,        z^2,        z,          C           
  662.    0,          0,          0,          0,          0
  663. >
  664.   sturm // optional, slower but reduces speckles
  665. }
  666. @com.------------------------------
  667. @mt2.smooth_triangle
  668. // rounded-surface triangle (don't try this at home!)
  669. smooth_triangle
  670. {
  671.   <  0,  30, 0> <0,  0.7071, -0.7071>  // <Vertex1>  <SurfaceNormal1>
  672.   < 40, -20, 0> <0, -0.8664, -0.5>     // <Vertex2>  <SurfaceNormal2>
  673.   <  0,   0, 0> <0, -0.5,    -0.8664>  // <Vertex3>  <SurfaceNormal3>
  674. }
  675. @com.------------------------------
  676. @mt2.Surface of Revolution
  677. // create a Surface of Revolution shape (like lathe, but faster)
  678. sor
  679. {
  680.     7, // # of points
  681.     <0.000000, 0.000000> // list of <u,v> points
  682.     <0.118143, 0.000000>
  683.     <0.620253, 0.540084>
  684.     <0.210970, 0.827004>
  685.     <0.194093, 0.962025>
  686.     <0.286920, 1.000000>
  687.     <0.468354, 1.033755>
  688.     open
  689. }
  690. @com.------------------------------
  691. @mt2.sphere
  692. // create a sphere shape
  693. sphere
  694. {
  695.   <0, 0, 0> // center of sphere <X Y Z>
  696.   2.0       // radius of sphere
  697. }
  698. @com.------------------------------
  699. @mt2.superellispoid
  700. // create a superquadric ellipsoid shape
  701. superellipsoid
  702. {
  703.   0.5,  // east-west exponent (0.0 ... 1.0)
  704.   1.0,  // north-south exponent (0.0 ... 1.0)
  705. }
  706. @com.------------------------------
  707. @mt2.text
  708. // create a TrueType text shape
  709. text
  710. {
  711.   ttf          // font type (only TrueType for now)
  712.   "cour.ttf",  // Microsoft Windows-format TrueType font file name
  713.   "POV-Ray",   // the string to create
  714.   2,           // the extrusion depth
  715.   0            // ?? FIXME
  716. }
  717. @com.------------------------------
  718. @mt2.torus
  719. // torus MAJOR, MINOR (in the X-Z plane)
  720. // MAJOR = float value giving the major radius
  721. // MINOR = float specifying the minor radius
  722. // The major radius extends from the center of the hole
  723. // to the mid-line of the rim while the minor radius
  724. // is the radius of the cross-section of the rim.
  725. torus { 1.0,  0.2 }
  726. @com.------------------------------
  727. @mt2.triangle
  728. // triangular surface (vertices are endpoints)
  729. triangle
  730. {
  731.   <-1,  0, -1>  // <Vertex1>
  732.   < 1,  0, -1>  // <Vertex2>
  733.   < 0,  0,  1>  // <Vertex3>
  734. }
  735. @com.============================================================
  736. @mt1.Shape modifiers
  737. @com.============================================================
  738. @com.------------------------------
  739. @mt2.bounded_by
  740. // set an outer proposed boundary for parent object(s)
  741. // allows the ray-tracer to do a quick check on the Bounding Shape,
  742. // and if outside, it skips checking this object.  Note that this
  743. // is not a 100% guaranteed clipping shape... use the
  744. // clipped_by statement for that.
  745. bounded_by { box { -(x+y+z) +(x+y+z) }
  746. @com.------------------------------
  747. @mt2.clipped_by
  748. // set clipping shape for parent object.
  749. // (parent shape will not extend beyond ClipShape bounds)
  750. clipped_by { sphere { 0*x, 1.0 } }
  751. @com.------------------------------
  752. @mt2.hollow
  753. // allow atmosphere inside shape
  754.   hollow
  755. @com.------------------------------
  756. @mt2.no_shadow
  757. // give object no shadow
  758.   no_shadow
  759. @com.============================================================
  760. @mt1.CSG operations
  761. @com.============================================================
  762. @com.------------------------------
  763. @mt2.difference
  764. // CSG difference, subtract intersections of shapes 2...N from Shape1
  765. difference
  766. {
  767.   Shape1 {...} // Start with this shape
  768.   Shape2 {...} // This will be "cut out" of Shape1
  769.   ShapeN {...} // This will be "cut out" of Shape1
  770. }
  771. @com.------------------------------
  772. @mt2.intersection
  773. // CSG intersection, the common space where all the shapes meet
  774. intersection
  775. {
  776.   Shape1 {...}
  777.   Shape2 {...}
  778.   ShapeN {...}
  779. }
  780. @com.------------------------------
  781. @mt2.inverse
  782. // flip an object's inside and outside for intersect/difference
  783. intersection
  784. {
  785.   Shape1 {...}
  786.   Shape2 {... inverse }
  787. }
  788. @com.------------------------------
  789. @mt2.merge
  790. // CSG merge, merge all of shapes 1...N
  791. // like ╥union╙, but no overlap seam lines
  792. merge
  793. {
  794.   Shape1 {...}
  795.   Shape2 {...}
  796.   ShapeN {...}
  797. }
  798. @com.------------------------------
  799. @mt2.union
  800. // CSG union, add all of shapes 1...N
  801. union
  802. {
  803.   Shape1 {...}
  804.   Shape2 {...}
  805.   ShapeN {...}
  806. }
  807. @com.============================================================
  808. @mt1.Transformations
  809. @com.============================================================
  810. @mt2.matrix
  811. // Matrix is an object transformation that does rotation about the Y axis,
  812. // shear along the Y axis, and translation along the Y axis
  813. matrix
  814. <
  815.   0.886, 0.5, 0.5,
  816.   0,     1,   0,
  817.   0.5,   0,  -0.886,
  818.   0,     1.5, 0
  819. >
  820. @com.------------------------------
  821. @mt2.rotate
  822. // rotate shape or texture around <0 0 0>, relative to current orientation
  823. // example: rotate 30*x
  824. rotate <45, 45, 0> // <dX  dY  dZ> (in degrees)
  825. @com.------------------------------
  826. @mt2.scale
  827. // "resize" an object or texture relative to its current size
  828. // example: scale 2.0
  829. scale <1.0,  2.0,  1.0> // <dX dY dZ>
  830. @com.------------------------------
  831. @mt2.translate
  832. // Move object or texture relative to current position
  833. // example: translate -5.0*z
  834. translate <2.0, 4.0, -1.0>  // <dX dY dZ>
  835. @com.------------------------------
  836. @mt2.Transform
  837. // object/texture transformation
  838. // do a predeclared translate/rotate/scale combo
  839. // e.g.:
  840. #declare Leaf_Orientation = transform { scale 4.0 rotate 30*z translate 2*y }
  841. transform Leaf_Orientation // transform an object
  842. @com.============================================================
  843. @mt1.Textures
  844. @com.============================================================
  845. @com.------------------------------
  846. @mt2.texture
  847. texture
  848. {
  849.   pigment
  850.   {
  851.     marble // some pattern
  852.     // optional color_map
  853.     turbulence 0.5
  854.     scale <1,3,1>// translformations
  855.   }
  856. //  halo  { }
  857.   normal
  858.   {
  859.     marble // some pattern
  860.     turbulence 0.5
  861.     scale <1,3,1>// translformations
  862.   }
  863.   finish
  864.   {
  865.     ambient 0.2
  866.     specular 0.6
  867.   }
  868. }
  869. @com.------------------------------
  870. @mt2.agate
  871. // texture pattern
  872.   agate // use an agate-like texture
  873.   agate_turb 0.3 // can alter turbulence [1.0]
  874.   // color_map {...} // optional color map
  875. @com.------------------------------
  876. @mt2.ambient
  877. // texture finish {} attribute
  878. ambient 0.2 // set ambient surface reflection (0...1) [0.1]
  879. @com.------------------------------
  880. @mt2.Attenuation
  881. // texture finish attribute
  882.    fade_distance FADE_DISTANCE
  883.    fade_power FADE_POWER
  884. @com.------------------------------
  885. @mt2.bozo
  886. // texture pattern
  887. bozo // use color map to swirl colors
  888. // turbulence 0.3
  889. // color_map...
  890. @com.------------------------------
  891. @mt2.brick
  892. // texture pattern
  893.   pigment
  894.   {
  895.     brick color Red, color Gray
  896.     brick_size <2,1,1> // size of brick
  897.     mortar 0.2         // width of mortar
  898.   }
  899. @com.------------------------------
  900. @mt2.brilliance
  901. // texture finish {} attribute
  902. brilliance 0.5 // tightness of diffuse illumination
  903. @com.------------------------------
  904. @mt2.bumps
  905. // texture normal {} attribute
  906. bumps 0.3 // bumpy surface (0...1)
  907. @com.------------------------------
  908. @mt2.caustics
  909. // texture finish attribute
  910.    caustics POWER
  911. @com.------------------------------
  912. @mt2.checker
  913. // texture pattern
  914. // square checker pattern, alternates color1 and color2
  915. // checkers are in the X-Z plane, extending infinitely in Y plane
  916. checker
  917.   color red 1 green 1 blue 1
  918.   color red 0 green 1 blue 0
  919. @com.------------------------------
  920. @mt2.color
  921. // texture pigment {} attribute
  922. // RGB values can range from 0.0 (dark) to 1.0 (saturated)
  923. color red 0.5 green 0.5 blue 0.5 // filter 0.8
  924. @com.------------------------------
  925. @mt2.color_map
  926. // texture pigment {} attribute
  927. // create a smooth color gradation map
  928. color_map
  929. {
  930.   // [ END_VAL color red R green G blue B filter F transmit T]
  931.   //   -or old style-
  932.   // [ START_VAL END_VAL color red R green G blue B filter F color red R green G blue B filter F]
  933.   [  0.1  color red 0.0 green 0.0 blue 0.0]
  934.   [  0.3  color red 0.8 green 0.4 blue 0.2]
  935.   [  0.5  color red 0.0 green 0.0 blue 0.0]
  936.   [  0.7  color red 0.0 green 0.0 blue 0.8 filter 0.5]
  937.   [  1.0  color red 0.8 green 0.8 blue 0.8 filter 1.0]
  938. } // color_map
  939. @com.------------------------------
  940. @mt2.crackle
  941. // texture pattern
  942.    crackle 0.5 turbulence 0.5
  943. @com.------------------------------
  944. @mt2.crand
  945. // texture finish {} attribute
  946. // randomly speckle the surface
  947.  // Note, this is truly random, and looks BAD in animations
  948. crand 0.2
  949. @com.------------------------------
  950. @mt2.dents
  951. // texture normal attribute
  952. dents 0.6 // dented surface (0...1) [0.0]
  953. @com.------------------------------
  954. @mt2.diffuse
  955. // texture finish attribute
  956. diffuse 0.6 // amount of diffuse lighting (0...1) [0.6]
  957. @com.------------------------------
  958. @mt2.finish
  959. // texture statement
  960. finish { ambient 0.2 specular 0.5 reflection 0.2 }
  961. @com.------------------------------
  962. @mt2.frequency
  963. // texture pigment/normal attribute
  964. frequency 2.0 // oscillation freq. of radial, ripples, waves, etc
  965. @com.------------------------------
  966. @mt2.gradient
  967. // texture pigment/normal attribute
  968. gradient x+y // specify color_map direction(s)
  969. // color_map {...} // requires a color map
  970. @com.------------------------------
  971. @mt2.granite
  972. // texture pigment attribute
  973. granite // create a granite-like texture
  974. // color_map {...} // optional color map
  975. @com.------------------------------
  976. @mt2.halo
  977. // texture component
  978. /*
  979.   halo {
  980.     attenuating | emitting | glowing | dust
  981.     [ constant | linear | cubic | poly ]
  982.     [ planar_mapping | spherical_mapping |
  983.       cylindrical_mapping | box_mapping ]
  984.     [ dust_type DUST_TYPE ]
  985.     [ eccentricity ECCENTRICITY ]
  986.     [ max_value MAX_VALUE ]
  987.     [ exponent EXPONENT ]
  988.     [ samples SAMPLES ]
  989.     [ aa_level AA_LEVEL ]
  990.     [ aa_threshold AA_THRESHOLD ]
  991.     [ jitter JITTER ]
  992.     [ turbulence <TURBULENCE> ]
  993.     [ octaves OCTAVES ]
  994.     [ omega OMEGA ]
  995.     [ lambda LAMBDA ]
  996.     [ colour_map COLOUR_MAP ]
  997.     [ frequency FREQUENCY ]
  998.     [ phase PHASE ]
  999.     [ scale <VECTOR> ]
  1000.     [ rotate <VECTOR> ]
  1001.     [ translate <VECTOR> ]
  1002.   }
  1003. */
  1004. halo
  1005. {
  1006.   dust
  1007.   dust_type 2
  1008.   constant
  1009.   spherical_mapping
  1010.   max_value 1.0
  1011.   colour_map
  1012.   {
  1013.     [ 0 color rgbf <1, 1, 1, 0.0> ]
  1014.     [ 1 color rgbf <1, 1, 1, 0.1> ]
  1015.   } 
  1016.   samples 100
  1017.   aa_level 5
  1018.   aa_threshold 0.1
  1019.   jitter 0.8
  1020. }  
  1021. @com.------------------------------
  1022. @mt2.hexagon
  1023. // texture pigment attribute
  1024. // create a hexagonal pattern texture with 3 colors
  1025. // hexagons are in the X-Z plane, extending infinitely in Y plane
  1026. hexagon
  1027.   color blue 1
  1028.   color red 1
  1029.   color green 1
  1030. @com.------------------------------
  1031. @mt2.irid
  1032. // texture finish {} attribute
  1033. //  irid { AMOUNT thickness THICKNESS turbulence TURBULENCE }
  1034.   irid { 0.8 thickness 0.2 turbulence 1.0 }
  1035. @com.------------------------------
  1036. @mt2.ior
  1037. // texture finish {} attribute
  1038. // 1.0=air, 1.33=water, 1.5=glass, 2.4=diamond (see also IOR.INC)
  1039. ior 1.3 // index of refraction
  1040. @com.------------------------------
  1041. @mt2.lambda
  1042. // texture pigment/normal attribute
  1043. // change surface perturbation property
  1044. // makes turbulence more "swirly"
  1045. lambda 1.2 // (1.0...5.0) [2.0]
  1046. @com.------------------------------
  1047. @mt2.leopard
  1048. // texture pigment/normal attribute
  1049. leopard // create a leopard spotted texture
  1050. // color_map {...} // optional color map
  1051. @com.------------------------------
  1052. @mt2.mandel
  1053. // texture pigment/normal attribute
  1054. // create a mandelbrot fractal surface in the X-Y plane
  1055. mandel 50 // (2...1000) [256]
  1056. // scale <...> translate <...> // zoom and move
  1057. // color_map {...} // requires a color map
  1058. @com.------------------------------
  1059. @mt2.marble
  1060. // texture pigment/normal attribute
  1061. marble // create a marble-like texture
  1062. // turbulence 1.0 // should have some!
  1063. // color_map {...} // uses a color map
  1064. @com.------------------------------
  1065. @mt2.metallic
  1066. // texture finish attribute
  1067. // use surface color, not light source color for phong hilights
  1068. metallic on // on/off
  1069. @com.------------------------------
  1070. @mt2.normal
  1071. // texture statement
  1072.   normal { wrinkles 0.5 scale 0.5 }
  1073. @com.------------------------------
  1074. @mt2.octaves
  1075. // texture pigment/normal attribute
  1076. // increases the "folds" in turbulence changes
  1077. octaves 3 // (1...10) [6]
  1078. @com.------------------------------
  1079. @mt2.omega
  1080. // texture pigment/normal attribute
  1081. // change surface perturbation property
  1082. // makes turbulence more "krinkly"
  1083. omega 1.2 // (0.0...2.0) [0.5]
  1084. @com.------------------------------
  1085. @mt2.onion
  1086. // texture pigment/normal attribute
  1087. onion // create an onion-like concentric circle texture
  1088. // color_map {...} // requires a color map
  1089. @com.------------------------------
  1090. @mt2.phase
  1091. // texture pigment/normal attribute
  1092. // change the phase of ripples, etc.
  1093. // Animation note:  As phase DECREASES, ripples move OUTWARD.
  1094. phase 0.5
  1095. @com.------------------------------
  1096. @mt2.phong
  1097. // texture finish attribute
  1098. // add phong hilighting to surface (0...1)
  1099.  phong 0.8
  1100. @com.------------------------------
  1101. @mt2.phong_size
  1102. // texture finish attribute
  1103. // set the size of the phong spot (1...250) [40]
  1104. // 20=dull rubber, 40=plastic, 200=shiny glass
  1105. phong_size 80
  1106. @com.------------------------------
  1107. @mt2.quick_color
  1108. // texture pigment attribute
  1109. quick_color green 1 // low-quality quick-render color
  1110. @com.------------------------------
  1111. @mt2.quilted
  1112. // texture normal attribute
  1113. // creates a pattern like a quilt
  1114. quilted 0.4 // amount
  1115. control0 -1 // lower curvature (-1...1)
  1116. control1 1 // upper curvature (-1...1)
  1117. @com.------------------------------
  1118. @mt2.radial
  1119. // texture pattern
  1120. // radially projected color_map in X-Z
  1121. radial
  1122. // frequency 4.0 // increases # of color "spokes"
  1123. // color_map ...
  1124. @com.------------------------------
  1125. @mt2.reflection
  1126. // texture finish {} attribute
  1127. reflection 0.3 // amount of surface reflection (0...1) [0]
  1128. @com.------------------------------
  1129. @mt2.refraction
  1130. // texture finish {} attribute
  1131. // turn this on (1) if using "filter" in pigment colors
  1132. refraction 1 // amount of pass-through light (0 or 1) [0]
  1133. @com.------------------------------
  1134. @mt2.ripples
  1135. // texture normal {} attribute
  1136. ripples 0.5 // make surface ripply (0...1)
  1137. @com.------------------------------
  1138. @mt2.roughness
  1139. // texture finish {} attribute
  1140. // alters specular hilighting
  1141. roughness 0.01 // 1.0=rough, 0.001=smooth [0.05]
  1142. @com.------------------------------
  1143. @mt2.specular
  1144. // texture finish {} attribute
  1145. // Note: size of hilight depends on roughness attribute
  1146. specular 0.7 // use specular hilighting on surface (0...1) [0]
  1147. @com.------------------------------
  1148. @mt2.spiral1
  1149. // texture pattern
  1150.   spiral1 5
  1151. @com.------------------------------
  1152. @mt2.spiral2
  1153. // texture pattern
  1154.   spiral2 5, 0.6
  1155. @com.------------------------------
  1156. @mt2.spotted
  1157. // texture finish {} attribute
  1158. spotted // create a spotted texture
  1159. // color_map {...} // requires a color map
  1160. @com.------------------------------
  1161. @mt2.tiles
  1162. // texture attribute
  1163. // create a tiled texture, alternates between 2 full textures
  1164. tiles
  1165. {
  1166.   texture    // texture of tile #1
  1167.   {
  1168.     pigment { agate scale 0.3 }
  1169.   }
  1170.   tile2
  1171.   texture    // texture of tile #2
  1172.   {
  1173.     pigment { granite }
  1174.   }
  1175. } // tiles
  1176. @com.------------------------------
  1177. @mt2.turbulence
  1178. // texture pigment/normal attribute
  1179. // Takes a float or vector, see also octaves, omega, lambda, frequency
  1180. turbulence <0, 1, 0.5> // how much to ╥stir up╙ the texture (0...1 or more)
  1181. @com.------------------------------
  1182. @mt2.warp
  1183. // texture pigment modifier
  1184.     warp { turbulence 0.4*x octaves 2 repeat x*2  flip y  offset z*0.25 }
  1185. @com.------------------------------
  1186. @mt2.waves
  1187. // texture normal attribute
  1188. // create a wavy surface (also use phase)
  1189. waves 0.5
  1190. @com.------------------------------
  1191. @mt2.wood
  1192. // texture pigment {} attribute
  1193. // create a concentric cylindrical wood-like texture,
  1194. // grain along Z axis
  1195. wood
  1196. // turbulence 0.1 // should have some!
  1197. // color_map {...} // optional color map
  1198. @com.------------------------------
  1199. @mt2.wrinkles
  1200. // texture normal {} attribute
  1201. // create a wrinkly surface (0...1 or more)
  1202. wrinkles 0.5
  1203. @com.------------------------------
  1204. @mt2.irid
  1205. // texture finish attribute
  1206. irid { 0.8 // amount of iridescence saturation (0...1) [0]
  1207. // thickness N.N
  1208. // turbulence 0.N
  1209. }
  1210. @com.============================================================
  1211. @mt1.Texture Colors
  1212. @com.============================================================
  1213. @com.------------------------------
  1214. @mt2.blue
  1215. color blue 1
  1216. @com.------------------------------
  1217. @mt2.filter
  1218. color red 1 filter 1
  1219. @com.------------------------------
  1220. @mt2.green
  1221. color green 1
  1222. @com.------------------------------
  1223. @mt2.red
  1224. color red 1
  1225. @com.------------------------------
  1226. @mt2.transmit
  1227. color green 1 transmit 1
  1228. @com.------------------------------
  1229. @mt2.rgb
  1230. // rgb - Red Green Blue color shortcut
  1231. color rgb <0.2, 0.3, 0.4>
  1232. @com.------------------------------
  1233. @mt2.rgbf
  1234. // rgbf - Red Green Blue Filter color shortcut
  1235. color rgbf <0.2, 0.3, 0.4, 0.9>
  1236. @com.------------------------------
  1237. @mt2.rgbft
  1238. // rgbft - Red Green Blue Filter Transmit color shortcut
  1239. // NOTE: filter + transmit should always equal 1.0
  1240. color rgbft <0.5, 0.5, 0.5, 0.4, 0.6>
  1241. @com.------------------------------
  1242. @mt2.color components
  1243. // extract each component of a color:
  1244. // #if (MyColor.red < 0.5) ...
  1245. // #if (MyColor.green < 0.5) ...
  1246. // #if (MyColor.blue < 0.5) ...
  1247. // #if (MyColor.filter < 0.5) ...
  1248. // #if (MyColor.transmit < 0.5) ...
  1249. @com.============================================================
  1250. @mt1.Texture Image Maps
  1251. @com.============================================================
  1252. @com.------------------------------
  1253. @mt2.bump_map
  1254. // texture normal {} attribute
  1255. // create a texture that has a bumpiness corresponding to color index
  1256. // image maps into X-Y plane from <0,0,0> to <1,1,0>
  1257. bump_map
  1258. { // uses image color or index as bumpiness
  1259.   gif "plasma3.gif" // the file to read (iff/gif/tga/png/sys)
  1260.   map_type 0 // 0=planar, 1=spherical, 2=cylindrical, 5=torus
  1261.   interpolate 2 // 0=none, 1=linear, 2=bilinear, 4=normalized distance
  1262.   // [use_color | use_index]
  1263.   // [once]
  1264.   bump_size 0.5 // 0...3
  1265. } // bump_map
  1266. @com.------------------------------
  1267. @mt2.Image_map
  1268. // texture pigment {} attribute
  1269. // create a texture that lays an image's colors onto a surface
  1270. // image maps into X-Y plane from <0,0,0> to <1,1,0>
  1271. image_map
  1272. {
  1273.   gif "plasma3.gif" // the file to read (iff/gif/tga/png/sys)
  1274.   map_type 0 // 0=planar, 1=spherical, 2=cylindrical, 5=torus
  1275.   interpolate 2 // 0=none, 1=linear, 2=bilinear, 4=normalized distance
  1276.   // [filter N V] // N=all or color index # (0...N), V= value (0.0...1.0)
  1277.   // [transmit N V] // N=all or color index # (0...N), V= value (0.0...1.0)
  1278.   // [use_color | use_index]
  1279.   // [once]
  1280. } // image_map
  1281. @com.------------------------------
  1282. @mt2.Material_map
  1283. // texture attribute
  1284. // create a texture that maps different textures onto different color indexes
  1285. // image maps into X-Y plane from <0,0,0> to <1,1,0>
  1286. material_map
  1287. {
  1288.   gif "plasma3.gif" // the file to read (iff/gif/tga/png/sys)
  1289.   map_type 0 // 0=planar, 1=spherical, 2=cylindrical, 5=torus
  1290.   interpolate 2 // 0=none, 1=linear, 2=bilinear, 4=normalized distance
  1291.   // [once]
  1292.   texture { pigment {wood} }  // texture for color index # 0
  1293.   texture { pigment {granite} }  // texture for color index # 1
  1294.   texture { pigment {agate} }  // texture for color index # 2
  1295.   // etc...
  1296. } // material_map
  1297. @com.============================================================
  1298. @mt1.Std colors
  1299. @com.============================================================
  1300. @mt2."Colors.inc"
  1301. // Standard pre-defined colors
  1302. #include "colors.inc"
  1303. @com.============================================================
  1304. @mt1.Ready-Made Scenes
  1305. @com.============================================================
  1306. @com.------------------------------
  1307. @mt2.Checkered floor
  1308. @com.------------------------------
  1309. @mt2.Image Map
  1310. @com.------------------------------
  1311. @mt2.Height-field logo
  1312. @com.
  1313. @com.============================================================
  1314. @com.end of file is next
  1315. @@@@
  1316.